gh-145000: Run check-html-ids.py in CI#145632
gh-145000: Run check-html-ids.py in CI#145632StanFromIreland wants to merge 15 commits intopython:mainfrom
check-html-ids.py in CI#145632Conversation
|
Annoyingly, no exclude file exists on main yet, and trying to add one here won't work, since the PR base won't have it. So, I am forced to leave a TODO. And we have the same issue with adding |
|
I don't like that |
In this instance, I think it is better to group them, creating a new module will just introduce more issues with passing inputs IMO. |
|
So we're building docs in the PR, then checking out the base branch, building the docs again, and comparing? It only takes a couple of minutes for that base branch build, but it feels like we could avoid this extra CI work somehow? Of course, we don't build docs for every PR, so that reduces it. And we also don't build docs for regular pushes to |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Yeah, that's wasteful. |
Then we'd have to host it for every commit, or accept that much more frequent branch updates are necessary (which is also wasteful). For example, commits: When the CI runs on C, it will pull the base IDs. But, the IDs added by B will be missing at C, so the CI will falsely report it as removed. |
|
For the record, we discussed this during Petr's docs meeting yesterday.
|
After some more thought, it does not actually complicate anything, and as such, I have decided to do this. |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
| # shellcheck disable=SC2046 | ||
| python Doc/tools/check-html-ids.py -v check \ | ||
| /tmp/html-ids-base.json.gz /tmp/html-ids-head.json.gz \ | ||
| $([ -f Doc/tools/removed-ids.txt ] && echo "--exclude-file Doc/tools/removed-ids.txt") |
There was a problem hiding this comment.
The file now always exists?
| # shellcheck disable=SC2046 | |
| python Doc/tools/check-html-ids.py -v check \ | |
| /tmp/html-ids-base.json.gz /tmp/html-ids-head.json.gz \ | |
| $([ -f Doc/tools/removed-ids.txt ] && echo "--exclude-file Doc/tools/removed-ids.txt") | |
| python Doc/tools/check-html-ids.py -v check \ | |
| /tmp/html-ids-base.json.gz /tmp/html-ids-head.json.gz \ | |
| --exclude-file Doc/tools/removed-ids.txt |
There was a problem hiding this comment.
The file now always exists?
But only if people update their PRs, we can remove the check in a few months to avoid any CI breakage.
This doesn’t introduce any slowdown in the CI as the doctest job is slower. To avoid building the docs twice, I use the build from the
build-docstep to run the script and upload the results.🟢 Pass example
🔴 Fail example (When merged, it will properly fail, currently the script doesn’t
sys.exit(1))📚 Documentation preview 📚: https://cpython-previews--145632.org.readthedocs.build/